package com.xnyzc.lhy.common.penum.star;

public enum EStarType {

    star0(0, "差", "一星"),
    star1(1, "较差", "两星"),
    star2(2, "一般", "三星"),
    star3(3, "良好", "四星"),
    star4(4, "优秀", "五星");

    private Integer type;
    private String value;
    private String desc;

    EStarType(Integer type, String value, String desc) {
        this.type = type;
        this.value = value;
        this.desc = desc;
    }

    public static EStarType findById(Integer type) {
        EStarType eStarType;
        switch (type) {
            case 0:
                eStarType = EStarType.star0;
                break;
            case 1:
                eStarType = EStarType.star1;
                break;
            case 2:
                eStarType = EStarType.star2;
                break;
            case 3:
                eStarType = EStarType.star3;
                break;
            case 4:
                eStarType = EStarType.star4;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eStarType;
    }

    public String getValue() {
        return this.value;
    }

    public Integer getType() {
        return this.type;
    }

    public String getDesc(){
        return this.desc;
    }
}
